//
//  UIIlabel+Extension.swift
//  LSTools
//
//  Created by zrf on 2021/6/30.
//

import Foundation
public enum LSFontType {
    case regular
    case medium
    case semibold
}

public extension UILabel {
    class func createFast(_ colorOrString: Any, _ fontSize: CGFloat, fontType: LSFontType = .regular, text: String = "") -> UILabel {
        let label = UILabel()
        if let colorString = colorOrString as? String {
            label.textColor =  UIColor.hexColor(colorString) 
        } else if let color = colorOrString as? UIColor {
            label.textColor = color
        }
        label.text = text
        switch fontType {
        case .regular:
            label.font = RegularFont(fontSize)
        case .medium:
            label.font = MediumFont(fontSize)
        case .semibold:
            label.font = SemiblodFont(fontSize)
        }
        return label
    }
}
